// article catagory module

const express = require("express");
const router = express.Router();
const artCateHandle = require("../router-handler/artcate");
const expressJoi = require("@escook/express-joi");
const {
  add_cate_shema,
  delete_cate_schema,
  get_cate_schema,
  update_cate_schema,
} = require("../schema/artcate");

router.get(
  "/cates/:id",
  expressJoi(get_cate_schema),
  artCateHandle.getArticleCates
);

router.post(
  "/addcates",
  expressJoi(add_cate_shema),
  artCateHandle.addArticleCates
);

router.get(
  "/deletecate/:id",
  expressJoi(delete_cate_schema),
  artCateHandle.deleteCateById
);

router.post(
  "/updatecate",
  expressJoi(update_cate_schema),
  artCateHandle.updateCateById
);
module.exports = router;
